@extends("admin.layout.main")
@section("content")
    <div class="tpl-content-wrapper">
        <div class="tpl-content-page-title">
            文章管理
        </div>
        <ol class="am-breadcrumb">
            <li><a href="#" class="am-icon-home">首页</a></li>
            <li class="am-active">文章管理</li>
        </ol>
        @include("admin.layout.error")
        <div class="tpl-portlet-components">
            <div class="portlet-title">
                <div class="caption font-green bold">
                    <span class="am-icon-code"></span> 创建文章
                </div>
            </div>

            <div class="tpl-block ">
                <form class="am-form am-form-horizontal" method="post" action="/admin/post/store" enctype="multipart/form-data">
                <div class="am-g tpl-amazeui-form">
                    <div class="am-u-sm-12 am-u-md-9">
                            {{csrf_field()}}
                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label">标题 </label>
                                <div class="am-u-sm-9">
                                    <input type="text" id="user-name" name="title" minlength="3" placeholder="输入文章标题..." class="am-form-field" required>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label for="user-phone" class="am-u-sm-3 am-form-label">分类</label>
                                <div class="am-u-sm-9">
                                    <select data-am-selected="{searchBox: 1}" name="type_id">
                                        @foreach($types as $type)
                                            @if($type->tid==0)
                                            <optgroup label="{{$type->name}}">
                                                @foreach($types as $ty )
                                                    @if($type->id==$ty->tid)
                                                        <option value={{$ty->id}}>{{$ty->name}}</option>
                                                    @endif
                                                @endforeach
                                            </optgroup>
                                            @endif

                                        @endforeach
                                    </select>
                                </div>
                            </div>
                        <div class="am-form-group">
                            <label for="user-weibo" class="am-u-sm-3 am-form-label" >标签 </label>
                            <div class="am-u-sm-9">
                                <input type="text" name="tag" id="user-weibo" placeholder="请添加分类用点号隔开" required>
                                <div>

                                </div>
                            </div>
                        </div>
                            <div class="am-form-group">
                                <label for="user-intro" class="am-u-sm-3 am-form-label">内容 </label>
                            </div>
                    </div>
                </div>
                <div class="tpl-alert">
                    <textarea name="content" id="desc" rows="20" id="user-intro" placeholder="输入个人简介" minlength="15" required></textarea>
                </div>
                <div class="am-g tpl-amazeui-form">
                    <div class="am-u-sm-12 am-u-md-9">

                            <div class="am-form-group">
                                <div class="am-u-sm-9 am-u-sm-push-3">
                                    <button type="submit" class="am-btn am-btn-primary">保存</button>
                                </div>
                            </div>

                    </div>

                </div>
                </form>
            </div>
        </div>

    </div>
@endsection